home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / 422mods.zip / TFC018.422 < prev    next >
Text File  |  1993-03-20  |  3KB  |  120 lines

  1. 2TFC018.MOD 1Logoff Countdown Delay
  2. The Flying Chicken [SysOp] #1 @12456
  3. 3Friday, March 19, 1993  1 5:52 pm
  4. TFC018.MOD - Logoff Countdown Delay
  5. Author:     The Flying Chicken 
  6. Source:     WWIV 4.20-4.22
  7. Version:    1.2
  8.  
  9.     When using batch downloads, you have the option to log off after
  10.     the transfer is complete.  Well, I have sometimes wished I could
  11.     abort that feature, so this is the mod to do it.  I counts down
  12.     from 5 to 1, and at 1 it logs the user off.  If the user types
  13.     Ctrl-K, the logoff will be aborted.
  14.  
  15.     v1.2 - Upgrade for 4.22
  16.     v1.0 - Initial release
  17.  
  18.  
  19.     Before using this or any mod, back up your source !!!!!
  20.  
  21.                 PKZIP source *.c *.h *.mak
  22.  
  23.  
  24.     1. First, load up FCNS.H and search for /* File: batch.c */.  Then
  25.        add the following line, as shown.
  26.  
  27. void run_cmd(char *cmdln, char *downlist, char *uplist, char *dl, int had);
  28. void process_dszlog();
  29. void dszbatchdl(int had, char *cmdln, char *desc);
  30. void dszbatchul(int had, char *cmdln, char *desc);
  31. void bibatch(int had, int pn);
  32. void batchdl();
  33. void logoff_countdown(int *had);                        /* ADD */
  34.  
  35.  
  36.     2. Save FCNS.H and load up BATCH.C.  Search for void ymbatchdl() and
  37.        and the following function right before it.
  38.  
  39. void logoff_countdown(int *had)                   /* ADD ENTIRE VOID */
  40. {
  41.     int     i;
  42.     char    ch;
  43.  
  44.     nl();
  45.     prt(1,"Logoff sequence commencing.  Type [Ctrl-K] to abort logoff.");
  46.     nl();nl();
  47.     ansic(2);
  48.     for (i=5;((*had) && (i>0));i--) {
  49.         npr("%d",i);
  50.         delay(1000);
  51.         ch=inkey();
  52.         if (ch==11)
  53.             *had=0;
  54.         else
  55.             npr("\b");
  56.     }
  57.     nl();
  58.     if (!(*had)) {
  59.         nl();
  60.         prt(1,"Logoff sequence aborted.  Returning to the BBS.");
  61.         nl();
  62.     }
  63. }
  64.  
  65.  
  66.     3. Scroll down towards the end of ymbatchdl() and make these changes.
  67.  
  68.   if (rr) {
  69.     nl();
  70.     pl("Your ratio is too low to continue the transfer.");
  71.     nl();
  72.   }
  73.   if (had) {
  74.     logoff_countdown(&had);                     /* ADD */
  75.     if (had) {                                  /* ADD */
  76.         dtr(0);
  77.         hangup=1;
  78.     }                                           /* ADD */
  79.   }
  80. }
  81.  
  82.  
  83.     4. Search for void rum_cmd() and make these changes.
  84.  
  85.       if (uplist[0])
  86.         cd_to(syscfg.batchdir);
  87.  
  88.       run_external1(s);
  89.  
  90.       cd_to(cdir);
  91.  
  92.       if (had) {
  93.         logoff_countdown(&had);             /* ADD */
  94.         if (had) {                          /* ADD */
  95.             dtr(0);
  96.             hangup=1;
  97.             if (modem_flag & flag_ec)   /* in 4.22 ONLY */
  98.                 wait1(36)               /* in 4.22 ONLY */
  99.             else                        /* in 4.22 ONLY */
  100.                 wait1(2);
  101.             if (!cdet()) {
  102.               dtr(1);
  103.               wait1(5);                 /* in 4.22 ONLY */
  104.               wait1(2);                 /* pre 4.22 ONLY */
  105.               holdphone(1);
  106.             }
  107.         }                                   /* ADD */
  108.       } else {
  109.         nl();
  110.         pl("Please wait...");
  111.  
  112.  
  113.  
  114.     DISCLAIMER:  I make no guarantees with this mod whatsoever.
  115.     Your installation of the mod is your acceptance of any
  116.     damages caused to your hardware or software, incendental or
  117.     otherwise.
  118.  
  119.     PLEASE REPORT ANY BUGS.
  120.